Skip to contentSkip to conversation

kernel-yocto-rust: Move rust kernel dependencies to bbclass

PATCH In review [email protected] 3 participants 4 messages Mar 17 – Mar 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-yocto-rust: Move rust kernel dependencies to bbclass

From: Harish Sadineni <[email protected]>

Move the rust kernel dpendencies from linux-yocto.inc to kernel-yocto-rust.bbclass.

This centralizes Rust-specific configuration in the dedicated class, which is intended to be inherited only when Rust kernel support is enabled (e.g. via KERNEL_FEATURES).

---
 meta/classes-recipe/kernel-yocto-rust.bbclass | 2 ++
 meta/recipes-kernel/linux/linux-yocto.inc     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/kernel-yocto-rust.bbclass +2 -0
index 608ccc4609..49f2bfc1ae 100644
@@ -10,6 +10,8 @@ RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
 KRUSTFLAGS = " ${RUST_DEBUG_REMAP}"
 EXTRA_OEMAKE:append = " KRUSTFLAGS='${KRUSTFLAGS}'"
 
+RUST_KERNEL_DEPENDS ?= "clang-native rust-native bindgen-cli-native"
+DEPENDS += "${RUST_KERNEL_DEPENDS}"
 RUST_KERNEL_TASK_DEPENDS ?=  "rust-native:do_populate_sysroot clang-native:do_populate_sysroot bindgen-cli-native:do_populate_sysroot"
 do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"
 
meta/recipes-kernel/linux/linux-yocto.inc +0 -2
index f47873348a..4e230d405a 100644
@@ -81,8 +81,6 @@ KERNEL_DEBUG ?= ""
 DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc" ], "elfutils-native", "", d)}'
 DEPENDS += "openssl-native util-linux-native"
 DEPENDS += "gmp-native libmpc-native"
-RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'clang-native rust-native bindgen-cli-native', '', d)}"
-DEPENDS += "${RUST_KERNEL_DEPENDS}"
 
 # Some options depend on CONFIG_PAHOLE_VERSION, so need to make pahole-native available before do_kernel_configme
 do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG", "True", "pahole-native:do_populate_sysroot", "", d)}'
Signature · 1 line
2.49.0
#1 lore raw

Sadineni, Harish via lists.openembedded.org <Harish.Sadineni= [email protected]> escreveu (terça, 17/03/2026 à(s) 18:08):

Quoted 21 lines

From: Harish Sadineni <[email protected]>

Move the rust kernel dpendencies from linux-yocto.inc to kernel-yocto-rust.bbclass.

This centralizes Rust-specific configuration in the dedicated class, which is intended to be inherited only when Rust kernel support is enabled (e.g. via KERNEL_FEATURES).

---
 meta/classes-recipe/kernel-yocto-rust.bbclass | 2 ++
 meta/recipes-kernel/linux/linux-yocto.inc     | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/kernel-yocto-rust.bbclass +0 -0
index 608ccc4609..49f2bfc1ae 100644

meta/classes-recipe/kernel-yocto-rust.bbclass RUST_DEBUG_REMAP = · line 16

Quoted 7 lines
meta/classes-recipe/kernel-yocto-rust.bbclass +2 -0
@@ -10,6 +10,8 @@ RUST_DEBUG_REMAP =
 "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
 KRUSTFLAGS = " ${RUST_DEBUG_REMAP}"
 EXTRA_OEMAKE:append = " KRUSTFLAGS='${KRUSTFLAGS}'"
 
+RUST_KERNEL_DEPENDS ?= "clang-native rust-native bindgen-cli-native"
+DEPENDS += "${RUST_KERNEL_DEPENDS}"
 

Any special reason to have this RUST_KERNEL_DEPENDS variable? It is not used anywhere else.
I wonder if just the DEPENDS could be used directly.

Jose

Quoted 37 lines
meta/classes-recipe/kernel-yocto-rust.bbclass +0 -0
 RUST_KERNEL_TASK_DEPENDS ?=  "rust-native:do_populate_sysroot

clang-native:do_populate_sysroot bindgen-cli-native:do_populate_sysroot"
do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"

meta/recipes-kernel/linux/linux-yocto.inc +0 -0
index f47873348a..4e230d405a 100644
@@ -81,8 +81,6 @@ KERNEL_DEBUG ?= ""
 DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc"

], "elfutils-native", "", d)}'
DEPENDS += "openssl-native util-linux-native"
DEPENDS += "gmp-native libmpc-native"
-RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'clang-native rust-native bindgen-cli-native', '', d)}" -DEPENDS += "${RUST_KERNEL_DEPENDS}"

# Some options depend on CONFIG_PAHOLE_VERSION, so need to make
pahole-native available before do_kernel_configme
do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG",
"True", "pahole-native:do_populate_sysroot", "", d)}'
--
2.49.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#233331):
https://lists.openembedded.org/g/openembedded-core/message/233331
Mute This Topic: https://lists.openembedded.org/mt/118369300/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma
#2 lore raw
Quoted 40 lines · Jose Quaresma

**
*CAUTION: This email comes from a non Wind River email account!*
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Sadineni, Harish via lists.openembedded.org <https://urldefense.com/v3/__http://lists.openembedded.org__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B_kjeB1qQ$> <[email protected]> escreveu (terça, 17/03/2026 à(s) 18:08):

    From: Harish Sadineni <[email protected]>

    Move the rust kernel dpendencies from linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
    to
    kernel-yocto-rust.bbclass.

    This centralizes Rust-specific configuration in the dedicated class,
    which is intended to be inherited only when Rust kernel support is
    enabled (e.g. via KERNEL_FEATURES).

    Signed-off-by: Harish Sadineni <[email protected]>
    ---
     meta/classes-recipe/kernel-yocto-rust.bbclass | 2 ++
     meta/recipes-kernel/linux/linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$> 
       | 2 --
     2 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/meta/classes-recipe/kernel-yocto-rust.bbclass
    b/meta/classes-recipe/kernel-yocto-rust.bbclass
    index 608ccc4609..49f2bfc1ae 100644
    --- a/meta/classes-recipe/kernel-yocto-rust.bbclass
    +++ b/meta/classes-recipe/kernel-yocto-rust.bbclass
    @@ -10,6 +10,8 @@ RUST_DEBUG_REMAP =
    "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
     KRUSTFLAGS = " ${RUST_DEBUG_REMAP}"
     EXTRA_OEMAKE:append = " KRUSTFLAGS='${KRUSTFLAGS}'"

    +RUST_KERNEL_DEPENDS ?= "clang-native rust-native bindgen-cli-native"
    +DEPENDS += "${RUST_KERNEL_DEPENDS}"
Quoted 2 lines

Any special reason to have this RUST_KERNEL_DEPENDS variable? It is not used anywhere else. I wonder if just the DEPENDS could be used directly.

In earlier revisions, Bruce suggested keeping these dependencies in a variable assigned with ?=. This approach makes it easier to customize them from bbappends and related use cases.

Thanks,
Harish

Quoted 57 lines

Jose

     RUST_KERNEL_TASK_DEPENDS ?= "rust-native:do_populate_sysroot
    clang-native:do_populate_sysroot
    bindgen-cli-native:do_populate_sysroot"
     do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"

    diff --git a/meta/recipes-kernel/linux/linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
    b/meta/recipes-kernel/linux/linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
    index f47873348a..4e230d405a 100644
    --- a/meta/recipes-kernel/linux/linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
    +++ b/meta/recipes-kernel/linux/linux-yocto.inc
    <https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
    @@ -81,8 +81,6 @@ KERNEL_DEBUG ?= ""
     DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64",
    "powerpc" ], "elfutils-native", "", d)}'
     DEPENDS += "openssl-native util-linux-native"
     DEPENDS += "gmp-native libmpc-native"
    -RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('KERNEL_FEATURES',
    'rust', 'clang-native rust-native bindgen-cli-native', '', d)}"
    -DEPENDS += "${RUST_KERNEL_DEPENDS}"

     # Some options depend on CONFIG_PAHOLE_VERSION, so need to make
    pahole-native available before do_kernel_configme
     do_kernel_configme[depends] +=
    '${@bb.utils.contains("KERNEL_DEBUG", "True",
    "pahole-native:do_populate_sysroot", "", d)}'
    -- 
    2.49.0


    -=-=-=-=-=-=-=-=-=-=-=-
    Links: You receive all messages sent to this group.
    View/Reply Online (#233331):
    https://lists.openembedded.org/g/openembedded-core/message/233331
    <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/message/233331__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B_uL3UByw$>
    Mute This Topic:
    https://lists.openembedded.org/mt/118369300/5052612
    <https://urldefense.com/v3/__https://lists.openembedded.org/mt/118369300/5052612__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9KMIuMgw$>
    Group Owner: [email protected]
    <mailto:openembedded-core%[email protected]>
    Unsubscribe:
    https://lists.openembedded.org/g/openembedded-core/unsub
    <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/unsub__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B_ZpNUFUA$>
    [[email protected]]
    -=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Best regards,

José Quaresma
#3 lore raw
Quoted 50 lines · Harish via lists.openembedded.org

On 3/18/2026 1:31 AM, Jose Quaresma wrote:

*CAUTION: This email comes from a non Wind River email account!* Do not click links or open attachments unless you recognize the sender and know the content is safe.

Sadineni, Harish via lists.openembedded.org
<https://urldefense.com/v3/__http://lists.openembedded.org__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B_kjeB1qQ$>
<[email protected]> escreveu (terça, 17/03/2026 à(s) 18:08):

Quoted 25 lines

From: Harish Sadineni <[email protected]>

Move the rust kernel dpendencies from linux-yocto.inc
<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
to
kernel-yocto-rust.bbclass.

This centralizes Rust-specific configuration in the dedicated class, which is intended to be inherited only when Rust kernel support is enabled (e.g. via KERNEL_FEATURES).

---
 meta/classes-recipe/kernel-yocto-rust.bbclass | 2 ++
 meta/recipes-kernel/linux/linux-yocto.inc
<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
   | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/kernel-yocto-rust.bbclass +0 -0
index 608ccc4609..49f2bfc1ae 100644

meta/classes-recipe/kernel-yocto-rust.bbclass RUST_DEBUG_REMAP = · line 16

Quoted 7 lines
meta/classes-recipe/kernel-yocto-rust.bbclass +2 -0
@@ -10,6 +10,8 @@ RUST_DEBUG_REMAP =
 "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \
 KRUSTFLAGS = " ${RUST_DEBUG_REMAP}"
 EXTRA_OEMAKE:append = " KRUSTFLAGS='${KRUSTFLAGS}'"
 
+RUST_KERNEL_DEPENDS ?= "clang-native rust-native bindgen-cli-native"
+DEPENDS += "${RUST_KERNEL_DEPENDS}"
 

Any special reason to have this RUST_KERNEL_DEPENDS variable? It is not used anywhere else.
I wonder if just the DEPENDS could be used directly.

Quoted 6 lines

In earlier revisions, Bruce suggested keeping these dependencies in a variable assigned with ?=.
This approach makes it easier to customize them from bbappends and related use cases.

Yes, exactly. This allows us (or someone like myself specifically) to easily override the
behaviour without a :remove

Bruce

Quoted 59 lines

Thanks,
Harish

Jose

Quoted 23 lines
meta/classes-recipe/kernel-yocto-rust.bbclass +0 -0
 RUST_KERNEL_TASK_DEPENDS ?=  "rust-native:do_populate_sysroot

clang-native:do_populate_sysroot bindgen-cli-native:do_populate_sysroot"
do_kernel_configme[depends] += "${RUST_KERNEL_TASK_DEPENDS}"

(quoted diff) +0 -0

<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
b/meta/recipes-kernel/linux/linux-yocto.inc
<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
index f47873348a..4e230d405a 100644
--- a/meta/recipes-kernel/linux/linux-yocto.inc
<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
<https://urldefense.com/v3/__http://linux-yocto.inc__;!!AjveYdw8EvQ!b2ICl_fijVSH2wVxqIv7GAO9M7s8y2roM4-SddwJPX71oFS2SfJg3Nz-LU_TqwuhSgmRgNbFlqz30xa1maTf9B9txvlTIQ$>

meta/classes-recipe/kernel-yocto-rust.bbclass +0 -0
@@ -81,8 +81,6 @@ KERNEL_DEBUG ?= ""
 DEPENDS += '${@bb.utils.contains_any("ARCH", [ "x86", "arm64", "powerpc"

], "elfutils-native", "", d)}'
DEPENDS += "openssl-native util-linux-native"
DEPENDS += "gmp-native libmpc-native"
-RUST_KERNEL_DEPENDS ?= "${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'clang-native rust-native bindgen-cli-native', '', d)}" <$%[email protected]('KERNEL_FEATURES','rust','clang-nativerust-nativebindgen-cli-native','',d)%7D> -DEPENDS += "${RUST_KERNEL_DEPENDS}"

Quoted 11 lines

# Some options depend on CONFIG_PAHOLE_VERSION, so need to make
pahole-native available before do_kernel_configme
do_kernel_configme[depends] += '${@bb.utils.contains("KERNEL_DEBUG",
"True", "pahole-native:do_populate_sysroot", "", d)}'
--
2.49.0

--
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#233358):
https://lists.openembedded.org/g/openembedded-core/message/233358
Mute This Topic: https://lists.openembedded.org/mt/118369300/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II